<template>
  <div class="">
    <input type="text" v-model="keyword" />
    <button @click="search">搜索</button>
  </div>
</template>

<script>
import { ref, reactive, toRefs } from "vue";
import { useStore } from "vuex";
import { useRouter, useRoute } from "vue-router";
import axios from "axios";
export default {
  setup(props, ctx) {
    const store = useStore();
    const router = useRouter();
    const route = useRoute();
    const data = reactive({
      keyword: "",
    });
    const search = () => {
      axios.get("/api/suggest?word=" + data.keyword).then((res) => {
        console.log(res);
      });
    };

    return { ...toRefs(data), search };
  },
};
</script>

<style lang="scss"></style>
